package com.glsc.ngateway.platform.utils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @author guoj
 * @description: Y/N校验
 * @date 2024/8/9 11:09
 */
public class YSENOValidator implements ConstraintValidator<YESNO,String> {


    @Override
    public void initialize(YESNO constraintAnnotation) {
        ConstraintValidator.super.initialize(constraintAnnotation);
    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        if ("Y".equals(value) || "N".equals(value)) {
            return true;
        }
        return false;
    }
}
